/*
  添加SKU参数类型

    {
      "category3Id": 0,
      "price": 0,
      "skuAttrValueList": [
        {
          "attrId": 0,
          "attrName": "string",
          "valueId": 0,
          "valueName": "string"
        }
      ],
      "skuDefaultImg": "string",
      "skuDesc": "string",
      "skuImageList": [
        {
          "imgName": "string",
          "imgUrl": "string",
          "isDefault": "string",
        }
      ],
      "skuName": "string",
      "skuSaleAttrValueList": [
        {
          "saleAttrId": 0,
          "saleAttrName": "string",
          "saleAttrValueId": 0,
          "saleAttrValueName": "string",
        }
      ],
      "spuId": 0,
      "weight": "string"
    }

  修改SKU参数类型
    {
      "category3Id": 0,
      "id": 0,
      "price": 0,
      "skuAttrValueList": [
        {
          "attrId": 0,
          "attrName": "string",
          "id": 0,
          "skuId": 0,
          "valueId": 0,
          "valueName": "string"
        }
      ],
      "skuDefaultImg": "string",
      "skuDesc": "string",
      "skuImageList": [
        {
          "id": 0,
          "imgName": "string",
          "imgUrl": "string",
          "isDefault": "string",
          "skuId": 0,
          "spuImgId": 0
        }
      ],
      "skuName": "string",
      "skuSaleAttrValueList": [
        {
          "id": 0,
          "saleAttrId": 0,
          "saleAttrName": "string",
          "saleAttrValueId": 0,
          "saleAttrValueName": "string",
          "skuId": 0,
          "spuId": 0
        }
      ],
      "spuId": 0,
      "weight": "string"
    }

  组件使用 skuFormData 数据类型
    
    {
      "price": 0,
      "skuAttrValueList": string[],
      "skuDefaultImg": "string",
      "skuDesc": "string",
      "skuImageList": [
        {
          "imgName": "string",
          "imgUrl": "string",
          "isDefault": "string",
        }
      ],
      "skuName": "string",
      "skuSaleAttrValueList": string[],
      "weight": "string"
    }
*/
import type { SpuImageList } from "./spuModels";

export interface SkuItem {
  category3Id?: number;
  id?: number;
  price: number;
  skuDefaultImg: string;
  skuDesc: string;
  skuImageList: SpuImageList;
  skuName: string;
  spuId?: number;
  weight: number;
}

export type SkuList = SkuItem[];

export interface GetSkuListResponse {
  records: SkuList;
  total: number;
}

export interface SkuSaleAttrValueItem {
  id?: number;
  saleAttrId: number;
  saleAttrName: string;
  saleAttrValueId: number;
  saleAttrValueName: string;
  skuId?: number;
  spuId?: number;
}

export type SkuSaleAttrValueList = SkuSaleAttrValueItem[];

export interface SkuAttrValueItem {
  attrId: number;
  attrName: string;
  id?: number;
  skuId?: number;
  valueId: number;
  valueName: string;
}

export type SkuAttrValueList = SkuAttrValueItem[];

export interface AddOrUpdateSkuParams extends SkuItem {
  skuSaleAttrValueList: SkuSaleAttrValueList;
  skuAttrValueList: SkuAttrValueList;
}

export interface SkuFormData extends SkuItem {
  skuSaleAttrValueList: string[];
  skuAttrValueList: string[];
}
